// 1.导入vue-router包
import VueRouter from 'vue-router'

// 导入tabbar组件
import home from './components/tabbar/home.vue'
import member from './components/tabbar/member.vue'
import shopcar from './components/tabbar/shopcar.vue'
import search from './components/tabbar/search.vue'

// 导入新闻列表
import NewsList from './components/news/NewsList.vue'

import newsinfo from './components/news/NewsInfo.vue'

// 导入图片列表
import photolist from './components/photolist/photolist.vue'

import photoinfo from './components/photolist/photoinfo.vue'

// 导入商品列表
import goodslist from './components/goods/goodslist.vue'
import goodsInfo from './components/goods/goodsInfo.vue'
//导入 商品图文介绍
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomment from './components/goods/goodscomment.vue'
// 3.创建路由
var router = new VueRouter({
    //配置路由规则
    routes:[
        {path:'/',redirect:'/home'},
        {path:'/home',component:home},
        {path:'/member',component:member},
        {path:'/shopcar',component:shopcar},
        {path:'/search',component:search},
        {path:'/home/newslist',component:NewsList},
        {path:'/home/newsinfo/:id',component:newsinfo},
        {path:'/home/photolist',component:photolist},
        {path:'/home/photoinfo/:id',component:photoinfo},
        {path:'/home/goods',component:goodslist},
        {path:'/home/goodsinfo/:id',component:goodsInfo,name:'goodsInfo'},
        {path:'/home/good/goodsdesc/:id',component:goodsdesc,name:'/home/goodsdesc'},
        {path:'/home/good/goodscomment/:id',component:goodscomment,name:'/home/goodscomment'}
    ]
    // linkActiveClass:'mui_active' //覆盖默认的高亮位置默认的类叫做router-link-active
    
})

// 需要向外暴露出去
export default router